package org.jeecg.modules.sistersophie.job;

import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.sistersophie.facade.InvoiceFacade;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 定时更新发票最后付款状态
 */
@Slf4j
public class InvoicePayWarningUpdateJob implements Job {

    @Autowired
    private InvoiceFacade invoiceFacade;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        String todayTime = DateUtil.today();
        //查询所有过期时间为当天的invoice 对象
        invoiceFacade.updatePayWaringFlag(todayTime);
    }
}
